package com.heima.article.job;

import com.heima.article.service.ApArticleService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Description: 热点文章计算
 * Author: Wzh
 * Date: 2024/8/6
 */
@Component
@Slf4j
public class HotArticleCalculationXxlJob {
    @Autowired
    private ApArticleService apArticleService;

    /**
     * 定时计算热点文章
     */
    @XxlJob(value = "hotArticleCalculationXxlJob")
    public void computeHotArticleJob(){
        log.info("----------定时计算热点文章开始了----------");
        apArticleService.computeHotArticle();
    }
}

